Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safeguard of H3Event body stream locking in edge runtime workaround #1521

Merged
merged 3 commits into from
Jul 10, 2024

Conversation

supersoniko
Copy link
Contributor

@supersoniko supersoniko commented May 31, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • infrastructure changes
  • Other... Please describe:

What is the current behavior?

https://github.com/solidjs/solid-start/blob/main/packages/start/src/runtime/server-handler.ts#L136
There's currently a workaround for edge runtimes to create a new Request object instead of using the current one.

What is the new behavior?

Add a safeguard for the edge runtime workaround when a stream is already locked to not create the new Request object.

Other information

My goal is to make Solid Start work 100% on the Azure Functions runtime. I currently have a PR open at Nitro to support the latest Azure Function runtime.

However there's currently an issue that the H3 event body stream is already locked when it gets to the part of the edge runtime workaround when running on Azure Functions, which causes issues with server actions.

Im happy to say that all Solid Start functionality seems to work on Azure Functions once we get around this locking issue.

Copy link

changeset-bot bot commented May 31, 2024

⚠️ No Changeset found

Latest commit: 2332413

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@supersoniko supersoniko changed the title Safeguard of H3Event Body Stream locking in Edge runtime workaround Safeguard of H3Event body stream locking in edge runtime workaround May 31, 2024
@ryansolid
Copy link
Member

Yeah I see hacks on hacks in there. I'm glad you figured something out. That being said. I'm going to probably need to test this fix against Vercel/Netlify edge as I thought the creation of the new Request was to get around stream locking so this fix may impact them.

@ryansolid ryansolid merged commit 8aa946f into solidjs:main Jul 10, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants